import Vue from 'vue'
import Router from 'vue-router'
import ModuleManager from '@/components/ModuleManager'
import RoleManager from '@/components/RoleManager'
import AdminUserManager from '@/components/AdminUserManager'
import Login from '@/components/Login'
import Index from '@/components/Index'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },

    {
      path: '/i',
      name: 'Index',
      component: Index,
      redirect: '/i/system/adminuser',
      children: [
        {
        path: '/i/system/adminuser',
        name: 'adminuser',
        component: () => import('@/components/AdminUserManager'),
        meta: {
          title: '用户管理'
        }
      },
      {
        path: '/i/system/role',
        name: 'role',
        component: () => import('@/components/RoleManager'),
        meta: {
          title: '角色管理'
        }
      },
      {
        path: '/i/system/module',
        name: 'module',
        component: () => import('@/components/ModuleManager'),
        meta: {
          title: '模块管理'
        }
      },
      {
        path: '/i/system/wsm',
        name: 'wsm',
        component: () => import('@/components/WebSystemMuenManager'),
        meta: {
          title: 'web系统菜单管理'
        }
      }
    ]
    },
    {
      path: '/lend',
      name: 'lend',
      component: Index,
      redirect: '/lend/system/adminuser',
      children: [
        {
        path: '/lend/system/adminuser',
        name: 'adminuser1',
        component: () => import('@/components/AdminUserManager'),
        meta: {
          title: '用户管理'
        }
      },
      {
        path: '/lend/system/role',
        name: 'role1',
        component: () => import('@/components/RoleManager'),
        meta: {
          title: '角色管理'
        }
      },
      {
        path: '/lend/system/module',
        name: 'module1',
        component: () => import('@/components/ModuleManager'),
        meta: {
          title: '模块管理'
        }
      },
      {
        path: '/lend/system/wsm',
        name: 'wsm1',
        component: () => import('@/components/WebSystemMuenManager'),
        meta: {
          title: 'web系统菜单管理'
        }
      }
    ]
    }
  ]
})
